Public Class ModuloForm

    Dim Accion_ As String
    Dim indicemodulo_ As Byte
    Dim MiModulo As New ModuloClass

    Public Property accion() As String
        Get
            Return Accion_
        End Get
        Set(ByVal value As String)
            Accion_ = value
        End Set
    End Property

    Dim indice_ As Byte
    Public Property indicemodulo() As Byte
        Get
            Return indicemodulo_
        End Get
        Set(ByVal value As Byte)
            indicemodulo_ = value
        End Set
    End Property

    Private Sub Aceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Aceptar.Click

        MiModulo.IdDia = ComboBox1.SelectedIndex + 1
        MiModulo.Inicio = ComboBox2.SelectedIndex + 1
        MiModulo.Fin = ComboBox3.SelectedIndex + 1

        Select Case Accion_
            Case "Alta"
                modulos_list.Add(MiModulo)

            Case "Elimina"
                modulos_list.RemoveAt(indice_)

            Case "Modifica"

                modulos_list.Item(indice_).IdDia = MiModulo.IdDia
                modulos_list.Item(indice_).Inicio = MiModulo.Inicio
                modulos_list.Item(indice_).Fin = MiModulo.Fin

                ModulosGrid.DataGridView1.Refresh()

        End Select

        Me.Close()
    End Sub

    Private Sub Cancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancelar.Click

        Me.Close()

    End Sub

End Class